package com.cfx.exercise_39;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class TestInetAdress {

	public static void main(String[] args) throws UnknownHostException {
		InetAddress add = InetAddress.getByName("www.baidu.com");
		System.out.println(add);
		System.out.println(add.getHostName());
		System.out.println(add.getHostAddress());
		
		InetAddress hostAdd = InetAddress.getLocalHost();
		System.out.println(hostAdd);
	}
}
